var mongoose = require("./db.js");
var schema = mongoose.Schema; //模型生成器(表生成器)
//建立表 并且指定字段
var leaveSchema = new schema({
  userid: String,
  username: String, //用户名
  leavereason: String, //请假理由
  start: Date, //请假开始时间
  end: Date, //请假结束时间
  extend: String, //附件(可选)
  type: Number, //请假的状态(1:待审批 2:同意 3:拒绝)
});

//转成数据模型导出
module.exports = mongoose.model("leaveinfo", leaveSchema);
